/* 
 * File:   main.cpp
 * Author: nstratos
 *
 * Created on September 19, 2012, 7:17 PM
 */

#include <cstdlib>
#include <iostream>
#include "Server.hpp"
#include "User.hpp"
#include "Die.hpp"
#include "Character.hpp"
#include "TooManyCharactersException.hpp"


using namespace std;

/*
 * 
 */
int main(int argc, char** argv) {
    Server* s = new Server("Petit");
    World* w = s->getWorld();
    s->printWelcomeMessage();
    string username;
    string cname;
    User* dm = s->createUser("dm");
    //while(1) {
        cout << "Enter your desired username: " << endl;
        cin >> username;
        User* u1 = s->createUser(username);
        cout << "Hello, " << u1->getUsername() << "!\n";
        cout << "Enter the name of your character: " << endl;
        cin >> cname;
        Character* c = u1->createRandomizedCharacter(cname);
        c->printCharacterSheet();
        Character* m = dm->createRandomizedCharacter("Random Goo Monster");
        cout << c->getName() << " you encountered a " << m->getName() << endl;
        m->printCharacterSheet();
        
    //}
    
    /*//u1->whoAmI();
    u1->setUsername("mikey");
    //u1->whoAmI();
    //u1.setUsername("mikey");
    //u1.whoAmI();
    //User u2("montana", 32);
    //u2.setUsername("tony");
    //u2.whoAmI();
    User* u2 = s->createUser("Tom", 37);
    u2->setUsername("tommy");
    User* u3 = s->Server::createUser("Ann", 23);
    u3->setUsername("annie");
    s->printUsers();
    //User user("Toby", 42);
    //user.whoAmI();
    //Die d20(20);
    //int roll = d20.roll();
    //cout << "The die rolled: " << roll << endl;
    //Character c("squiggs");
    Character* c = u1->createRandomizedCharacter("squiggs1");
    c->printCharacterSheet();
    u1->createRandomizedCharacter("squiggs2");
    u1->createRandomizedCharacter("squiggs3");
    u1->createRandomizedCharacter("squiggs4");
    u1->createRandomizedCharacter("squiggs5");
    u1->createRandomizedCharacter("squiggs6");
    u1->createRandomizedCharacter("squiggs7");
    u1->createRandomizedCharacter("squiggs8");
    u1->createRandomizedCharacter("squiggs9");
    u1->createRandomizedCharacter("squiggs10");
    try {
        u1->createRandomizedCharacter("squiggs11");
    } catch (TooManyCharactersException tmce) {
        cout << "Warning: " << tmce.what();
    }
    u1->printCharacters();*/



    return 0;
}

